package com.yunxi.controller.sto;

import com.yunxi.core.web.ApiResult;
import com.yunxi.core.web.ResponseUtil;
import com.yunxi.sto.pojo.*;
import com.yunxi.sto.service.FinanceReportDubboService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 金融报表 前端控制器
 * </p>
 *
 * @author caoYong
 * @since 2019-10-09
 */
@RestController
@RequestMapping("/admin/financeReport")
@Api(tags = "sto:financeReport", description = "金融报表接口")
public class FinanceReportController {
    private static final Logger logger = LoggerFactory.getLogger(FinanceReportController.class);

    @Autowired
    FinanceReportDubboService financeReportDubboService;

    @GetMapping("/businessCensus")
    @ApiOperation(value = "金融业务交付量(省)")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "pageNum", value = "分页页码", required = true, dataType = "int"),
            @ApiImplicitParam(paramType="query", name = "pageSize", value = "分页数量", required = true, dataType = "int")
    })
    public ApiResult businessCensus(BusinessCensusVO businessCensusVO, Integer pageNum, Integer pageSize) throws Exception {
        return ResponseUtil.ok(financeReportDubboService.businessCensus(businessCensusVO, pageNum, pageSize));
    }

    @GetMapping("/businessCensusList")
    @ApiOperation(value = "金融业务交付量(省)")
    public ApiResult businessCensusList(BusinessCensusVO businessCensusVO) throws Exception {
        return ResponseUtil.ok(financeReportDubboService.businessCensusList(businessCensusVO));
    }

    @GetMapping("/businessCensusMonth")
    @ApiOperation(value = "金融业务交付量(月)")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "pageNum", value = "分页页码", required = true, dataType = "int"),
            @ApiImplicitParam(paramType="query", name = "pageSize", value = "分页数量", required = true, dataType = "int")
    })
    public ApiResult businessCensusMonth(BusinessCensusVO businessCensusVO, Integer pageNum, Integer pageSize) throws Exception {
        return ResponseUtil.ok(financeReportDubboService.businessCensusMonth(businessCensusVO, pageNum, pageSize));
    }

    @GetMapping("/expCarLeaseTime")
    @ApiOperation(value = "体验车租赁时间明细")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "pageNum", value = "分页页码", required = true, dataType = "int"),
            @ApiImplicitParam(paramType="query", name = "pageSize", value = "分页数量", required = true, dataType = "int")
    })
    public ApiResult expCarLeaseTime(ExpCarVO expCarVO, Integer pageNum, Integer pageSize) throws Exception {
        return ResponseUtil.ok(financeReportDubboService.expCarLeaseTime(expCarVO, pageNum, pageSize));
    }

    @GetMapping("/expCarLeaseTimeList")
    @ApiOperation(value = "体验车租赁时间明细")
    public ApiResult expCarLeaseTimeList(ExpCarVO expCarVO) throws Exception {
        return ResponseUtil.ok(financeReportDubboService.expCarLeaseTimeList(expCarVO));
    }

    @GetMapping("/creditRepotr")
    @ApiOperation(value = "个人征信审批报表")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "pageNum", value = "分页页码", required = true, dataType = "int"),
            @ApiImplicitParam(paramType="query", name = "pageSize", value = "分页数量", required = true, dataType = "int")
    })
    public ApiResult creditRepotr(CreditReportVO creditReportVO, Integer pageNum, Integer pageSize) throws Exception {
        return ResponseUtil.ok(financeReportDubboService.creditRepotr(creditReportVO, pageNum, pageSize));
    }

    @GetMapping("/creditRepotrList")
    @ApiOperation(value = "个人征信审批报表")
    public ApiResult creditRepotrList(CreditReportVO creditReportVO) throws Exception {
        return ResponseUtil.ok(financeReportDubboService.creditRepotrList(creditReportVO));
    }

    @GetMapping("/expCarFree")
    @ApiOperation(value = "体验车空闲表")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "pageNum", value = "分页页码", required = true, dataType = "int"),
            @ApiImplicitParam(paramType="query", name = "pageSize", value = "分页数量", required = true, dataType = "int")
    })
    public ApiResult expCarFree(ExpCarFreeVO expCarFreeVO, Integer pageNum, Integer pageSize) throws Exception {
        return ResponseUtil.ok(financeReportDubboService.expCarFree(expCarFreeVO, pageNum, pageSize));
    }

    @GetMapping("/expCarFreeList")
    @ApiOperation(value = "体验车空闲表")
    public ApiResult expCarFreeList(ExpCarFreeVO expCarFreeVO) throws Exception {
        return ResponseUtil.ok(financeReportDubboService.expCarFreeList(expCarFreeVO));
    }

    @GetMapping("/productAnalyze")
    @ApiOperation(value = "产品分析报表")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "pageNum", value = "分页页码", required = true, dataType = "int"),
            @ApiImplicitParam(paramType="query", name = "pageSize", value = "分页数量", required = true, dataType = "int")
    })
    public ApiResult productAnalyze(ProductAnalyzeVO productAnalyzeVO, Integer pageNum, Integer pageSize) throws Exception {
        return ResponseUtil.ok(financeReportDubboService.productAnalyze(productAnalyzeVO, pageNum, pageSize));
    }

    @GetMapping("/productAnalyzeList")
    @ApiOperation(value = "产品分析报表")
    public ApiResult productAnalyzeList(ProductAnalyzeVO productAnalyzeVO) throws Exception {
        return ResponseUtil.ok(financeReportDubboService.productAnalyzeList(productAnalyzeVO));
    }

    // GET /admin/financeCompany/financeList 金融公司列表

}
